@zonos/elements 1.3.217 → 1.3.219

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (411) hide show
  1. package/dist/cjs/buildCartItemsByTempCart-309fcebf.js +28 -0
  2. package/dist/cjs/{cart-54ff39d6.js → cart-9a2b32e4.js} +91 -48
  3. package/dist/cjs/cleanHtmlMarkdown-577d0a77.js +999 -0
  4. package/dist/cjs/{handleFetch-0313ebba.js → handleFetch-45f35cac.js} +2 -1
  5. package/dist/cjs/index.cjs.js +20 -10
  6. package/dist/cjs/isCollectMobileTablet-7e57fd90.js +172 -0
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/localization-b12edb2a.js +738 -0
  9. package/dist/cjs/{paypal-e7504122.js → paypal-e80871d0.js} +13 -9
  10. package/dist/cjs/placeTestOrder-8222fe95.js +93 -0
  11. package/dist/cjs/{localization-721a5ec3.js → translationStore-20a6d8bf.js} +963 -734
  12. package/dist/cjs/{updateCheckoutSessionAttributes-8db49644.js → updateCheckoutSessionAttributes-c0853fdd.js} +1 -1
  13. package/dist/cjs/zonos-address_11.cjs.entry.js +103 -73
  14. package/dist/cjs/zonos-badge.cjs.entry.js +3 -3
  15. package/dist/cjs/{zonos-banner.cjs.entry.js → zonos-banner_2.cjs.entry.js} +40 -0
  16. package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
  17. package/dist/cjs/{zonos-cart-items_14.cjs.entry.js → zonos-cart-items_12.cjs.entry.js} +75 -1294
  18. package/dist/cjs/zonos-checkout.cjs.entry.js +27 -50
  19. package/dist/cjs/zonos-collapse.cjs.entry.js +2 -2
  20. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +92 -0
  21. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +810 -0
  22. package/dist/cjs/zonos-collect.cjs.entry.js +468 -0
  23. package/dist/cjs/zonos-component.cjs.entry.js +1 -1
  24. package/dist/cjs/zonos-confirm-dialog_2.cjs.entry.js +168 -0
  25. package/dist/cjs/zonos-controller.cjs.entry.js +85 -29
  26. package/dist/cjs/zonos-country-flag.cjs.entry.js +3 -2
  27. package/dist/cjs/zonos-country-select_4.cjs.entry.js +12 -11
  28. package/dist/cjs/zonos-elements.cjs.js +1 -1
  29. package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +16 -6
  30. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +35 -34
  31. package/dist/cjs/zonos-hello.cjs.entry.js +9 -8
  32. package/dist/cjs/zonos-input.cjs.entry.js +4 -4
  33. package/dist/cjs/zonos-language-select_2.cjs.entry.js +7 -6
  34. package/dist/cjs/zonos-link.cjs.entry.js +1 -1
  35. package/dist/cjs/zonos-logo.cjs.entry.js +2 -2
  36. package/dist/cjs/zonos-stripe-input.cjs.entry.js +8 -5
  37. package/dist/cjs/zonos-text.cjs.entry.js +1 -1
  38. package/dist/cjs/zonos-toggle.cjs.entry.js +2 -2
  39. package/dist/cjs/zonos-tooltip.cjs.entry.js +2 -2
  40. package/dist/cjs/zonos-v-stack.cjs.entry.js +2 -2
  41. package/dist/collection/collection-manifest.json +10 -0
  42. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +3 -0
  43. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +2 -2
  44. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +5 -1
  45. package/dist/collection/components/checkout/zonos-collect/assets/ChevronDownIcon.svg +1 -0
  46. package/dist/collection/components/checkout/zonos-collect/zonos-collect-cart-items/assets/empty-item.jpeg +0 -0
  47. package/dist/collection/components/checkout/zonos-collect/zonos-collect-cart-items/zonos-collect-cart-items.css +60 -0
  48. package/dist/collection/components/checkout/zonos-collect/zonos-collect-cart-items/zonos-collect-cart-items.js +39 -0
  49. package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/assets/RemoveIcon.svg +1 -0
  50. package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/assets/SuccessIcon.svg +1 -0
  51. package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/zonos-collect-finish.css +84 -0
  52. package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/zonos-collect-finish.js +403 -0
  53. package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/assets/chevronDownIcon.svg +1 -0
  54. package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/assets/globe.svg +3 -0
  55. package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/assets/zonosIconDark.svg +10 -0
  56. package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/assets/zonosIconLight.svg +10 -0
  57. package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/assets/zonosWordmark.svg +7 -0
  58. package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/zonos-collect-footer.css +152 -0
  59. package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/zonos-collect-footer.js +164 -0
  60. package/dist/collection/components/checkout/zonos-collect/zonos-collect-order-details/assets/ChevronDownIcon.svg +1 -0
  61. package/dist/collection/components/checkout/zonos-collect/zonos-collect-order-details/assets/ChevronUpIcon.svg +1 -0
  62. package/dist/collection/components/checkout/zonos-collect/zonos-collect-order-details/zonos-collect-order-details.css +109 -0
  63. package/dist/collection/components/checkout/zonos-collect/zonos-collect-order-details/zonos-collect-order-details.js +194 -0
  64. package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/assets/CheckmarkLineIcon.svg +1 -0
  65. package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/assets/RemoveLineIcon.svg +1 -0
  66. package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/zonos-collect-payment.css +98 -0
  67. package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/zonos-collect-payment.js +369 -0
  68. package/dist/collection/components/checkout/zonos-collect/zonos-collect-review/zonos-collect-review.css +68 -0
  69. package/dist/collection/components/checkout/zonos-collect/zonos-collect-review/zonos-collect-review.js +151 -0
  70. package/dist/collection/components/checkout/zonos-collect/zonos-collect-subtotal/zonos-collect-subtotal.css +78 -0
  71. package/dist/collection/components/checkout/zonos-collect/zonos-collect-subtotal/zonos-collect-subtotal.js +115 -0
  72. package/dist/collection/components/checkout/zonos-collect/zonos-collect.css +349 -0
  73. package/dist/collection/components/checkout/zonos-collect/zonos-collect.js +547 -0
  74. package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
  75. package/dist/collection/components/common/zonos-button/zonos-button.js +3 -3
  76. package/dist/collection/components/common/zonos-card/zonos-card.js +4 -4
  77. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +3 -3
  78. package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +3 -3
  79. package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +2 -2
  80. package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.js +3 -3
  81. package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +3 -3
  82. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
  83. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +3 -3
  84. package/dist/collection/components/common/zonos-h-stack/zonos-h-stack.css +38 -0
  85. package/dist/collection/components/common/zonos-h-stack/zonos-h-stack.js +63 -0
  86. package/dist/collection/components/common/zonos-input/zonos-input.js +4 -4
  87. package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
  88. package/dist/collection/components/common/zonos-link/zonos-link.js +1 -1
  89. package/dist/collection/components/common/zonos-loading-overlay/zonos-loading-overlay.js +1 -1
  90. package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
  91. package/dist/collection/components/common/zonos-rest-state/zonos-rest-state.js +3 -3
  92. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
  93. package/dist/collection/components/common/zonos-skeleton/assets/RemoveLineIcon.svg +3 -0
  94. package/dist/collection/components/common/zonos-skeleton/zonos-skeleton.css +40 -0
  95. package/dist/collection/components/common/zonos-skeleton/zonos-skeleton.js +102 -0
  96. package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +8 -5
  97. package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +5 -5
  98. package/dist/collection/components/common/zonos-stripe-select/zonos-stripe-select.js +5 -5
  99. package/dist/collection/components/common/zonos-text/zonos-text.css +1 -0
  100. package/dist/collection/components/common/zonos-toggle/zonos-toggle.js +2 -2
  101. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
  102. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
  103. package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.js +2 -2
  104. package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
  105. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
  106. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +4 -4
  107. package/dist/collection/components/main/zonos-controller.js +91 -25
  108. package/dist/collection/components/paypal/zonos-paypal-payment.js +13 -2
  109. package/dist/collection/components/store/checkout/cart.js +36 -15
  110. package/dist/collection/components/store/checkout/collect.js +157 -0
  111. package/dist/collection/components/store/checkout/paypal.js +4 -2
  112. package/dist/collection/components/store/checkout/stripe.js +31 -12
  113. package/dist/collection/components/store/translationStore/strings.arabic.js +48 -0
  114. package/dist/collection/components/store/translationStore/strings.base.js +48 -0
  115. package/dist/collection/components/store/translationStore/strings.chinese.js +48 -0
  116. package/dist/collection/components/store/translationStore/strings.danish.js +48 -0
  117. package/dist/collection/components/store/translationStore/strings.dutch.js +48 -0
  118. package/dist/collection/components/store/translationStore/strings.french.js +48 -0
  119. package/dist/collection/components/store/translationStore/strings.german.js +48 -0
  120. package/dist/collection/components/store/translationStore/strings.hebrew.js +48 -0
  121. package/dist/collection/components/store/translationStore/strings.indonesian.js +48 -0
  122. package/dist/collection/components/store/translationStore/strings.italian.js +48 -0
  123. package/dist/collection/components/store/translationStore/strings.japanese.js +48 -0
  124. package/dist/collection/components/store/translationStore/strings.korean.js +48 -0
  125. package/dist/collection/components/store/translationStore/strings.norwegian.js +48 -0
  126. package/dist/collection/components/store/translationStore/strings.polish.js +48 -0
  127. package/dist/collection/components/store/translationStore/strings.portuguese.js +48 -0
  128. package/dist/collection/components/store/translationStore/strings.russian.js +48 -0
  129. package/dist/collection/components/store/translationStore/strings.spanish.js +48 -0
  130. package/dist/collection/components/store/translationStore/strings.swedish.js +48 -0
  131. package/dist/collection/components/store/translationStore/strings.turkish.js +48 -0
  132. package/dist/collection/components/store/translationStore/strings.vietnamese.js +48 -0
  133. package/dist/collection/components/store/translationStore.js +2 -1
  134. package/dist/collection/components/stripe/zonos-address/zonos-address.js +35 -18
  135. package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.js +2 -2
  136. package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +2 -2
  137. package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +15 -2
  138. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
  139. package/dist/collection/components/utils/checkout/initCollect.js +15 -0
  140. package/dist/collection/components/utils/checkout/isCollectMobileTablet.js +10 -0
  141. package/dist/collection/components/utils/checkout/renderCheckoutCurrency.js +10 -1
  142. package/dist/collection/components/utils/getNextFallbackApi.js +1 -1
  143. package/dist/collection/components/utils/handleFetch.js +1 -0
  144. package/dist/collection/components/utils/renderFallback.js +7 -0
  145. package/dist/collection/scripts/_getZonosQaUrl.js +5 -1
  146. package/dist/collection/scripts/_zonosBase.js +7 -1
  147. package/dist/collection/types/checkout/api/PartyInfo.js +1 -0
  148. package/dist/collection/types/generated/graphql.internal.types.js +103 -0
  149. package/dist/collection/types/index.js +1 -0
  150. package/dist/esm/buildCartItemsByTempCart-c4488f73.js +26 -0
  151. package/dist/esm/{cart-010402f9.js → cart-acf4ebf5.js} +69 -28
  152. package/dist/esm/cleanHtmlMarkdown-b5b18743.js +997 -0
  153. package/dist/esm/{handleFetch-fa90f7f6.js → handleFetch-99218189.js} +2 -1
  154. package/dist/esm/index.js +20 -10
  155. package/dist/esm/isCollectMobileTablet-b72b81c5.js +165 -0
  156. package/dist/esm/loader.js +1 -1
  157. package/dist/esm/localization-8646f526.js +719 -0
  158. package/dist/esm/{paypal-70b140d9.js → paypal-2fa930eb.js} +8 -5
  159. package/dist/esm/placeTestOrder-d1ad9cf6.js +90 -0
  160. package/dist/esm/{localization-9db8b6e9.js → translationStore-c9743292.js} +963 -718
  161. package/dist/esm/{updateCheckoutSessionAttributes-691cdc6d.js → updateCheckoutSessionAttributes-92f42882.js} +1 -1
  162. package/dist/esm/zonos-address_11.entry.js +72 -42
  163. package/dist/esm/zonos-badge.entry.js +3 -3
  164. package/dist/esm/{zonos-banner.entry.js → zonos-banner_2.entry.js} +40 -1
  165. package/dist/esm/zonos-button_3.entry.js +3 -3
  166. package/dist/esm/{zonos-cart-items_14.entry.js → zonos-cart-items_12.entry.js} +24 -1241
  167. package/dist/esm/zonos-checkout.entry.js +8 -31
  168. package/dist/esm/zonos-collapse.entry.js +2 -2
  169. package/dist/esm/zonos-collect-cart-items_3.entry.js +86 -0
  170. package/dist/esm/zonos-collect-finish_6.entry.js +801 -0
  171. package/dist/esm/zonos-collect.entry.js +464 -0
  172. package/dist/esm/zonos-component.entry.js +1 -1
  173. package/dist/esm/zonos-confirm-dialog_2.entry.js +163 -0
  174. package/dist/esm/zonos-controller.entry.js +85 -29
  175. package/dist/esm/zonos-country-flag.entry.js +3 -2
  176. package/dist/esm/zonos-country-select_4.entry.js +12 -11
  177. package/dist/esm/zonos-elements.js +1 -1
  178. package/dist/esm/zonos-empty-state-payment_4.entry.js +16 -6
  179. package/dist/esm/zonos-hello-dialog.entry.js +7 -6
  180. package/dist/esm/zonos-hello.entry.js +3 -2
  181. package/dist/esm/zonos-input.entry.js +4 -4
  182. package/dist/esm/zonos-language-select_2.entry.js +7 -6
  183. package/dist/esm/zonos-link.entry.js +1 -1
  184. package/dist/esm/zonos-logo.entry.js +2 -2
  185. package/dist/esm/zonos-stripe-input.entry.js +9 -6
  186. package/dist/esm/zonos-text.entry.js +1 -1
  187. package/dist/esm/zonos-toggle.entry.js +2 -2
  188. package/dist/esm/zonos-tooltip.entry.js +2 -2
  189. package/dist/esm/zonos-v-stack.entry.js +2 -2
  190. package/dist/esm-es5/buildCartItemsByTempCart-c4488f73.js +1 -0
  191. package/dist/esm-es5/cart-acf4ebf5.js +1 -0
  192. package/dist/esm-es5/cleanHtmlMarkdown-b5b18743.js +1 -0
  193. package/dist/esm-es5/{handleFetch-fa90f7f6.js → handleFetch-99218189.js} +1 -1
  194. package/dist/esm-es5/index.js +1 -1
  195. package/dist/esm-es5/isCollectMobileTablet-b72b81c5.js +1 -0
  196. package/dist/esm-es5/loader.js +1 -1
  197. package/dist/esm-es5/localization-8646f526.js +1 -0
  198. package/dist/esm-es5/paypal-2fa930eb.js +17 -0
  199. package/dist/esm-es5/placeTestOrder-d1ad9cf6.js +1 -0
  200. package/dist/esm-es5/translationStore-c9743292.js +1 -0
  201. package/dist/esm-es5/{updateCheckoutSessionAttributes-691cdc6d.js → updateCheckoutSessionAttributes-92f42882.js} +1 -1
  202. package/dist/esm-es5/zonos-address_11.entry.js +1 -1
  203. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  204. package/dist/esm-es5/zonos-banner_2.entry.js +1 -0
  205. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  206. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -0
  207. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  208. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  209. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -0
  210. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -0
  211. package/dist/esm-es5/zonos-collect.entry.js +1 -0
  212. package/dist/esm-es5/zonos-component.entry.js +1 -1
  213. package/dist/esm-es5/zonos-confirm-dialog_2.entry.js +1 -0
  214. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  215. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  216. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  217. package/dist/esm-es5/zonos-elements.js +1 -1
  218. package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +1 -1
  219. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  220. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  221. package/dist/esm-es5/zonos-input.entry.js +1 -1
  222. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  223. package/dist/esm-es5/zonos-link.entry.js +1 -1
  224. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  225. package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
  226. package/dist/esm-es5/zonos-text.entry.js +1 -1
  227. package/dist/esm-es5/zonos-toggle.entry.js +1 -1
  228. package/dist/esm-es5/zonos-tooltip.entry.js +1 -1
  229. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  230. package/dist/scripts/index.d.ts +471 -4
  231. package/dist/scripts/index.js +1 -1
  232. package/dist/scripts/loadZonos.js +1 -1
  233. package/dist/scripts/zonos.js +1 -1
  234. package/dist/types/components/checkout/zonos-collect/zonos-collect-cart-items/zonos-collect-cart-items.d.ts +4 -0
  235. package/dist/types/components/checkout/zonos-collect/zonos-collect-finish/zonos-collect-finish.d.ts +49 -0
  236. package/dist/types/components/checkout/zonos-collect/zonos-collect-footer/zonos-collect-footer.d.ts +25 -0
  237. package/dist/types/components/checkout/zonos-collect/zonos-collect-order-details/zonos-collect-order-details.d.ts +29 -0
  238. package/dist/types/components/checkout/zonos-collect/zonos-collect-payment/zonos-collect-payment.d.ts +62 -0
  239. package/dist/types/components/checkout/zonos-collect/zonos-collect-review/zonos-collect-review.d.ts +22 -0
  240. package/dist/types/components/checkout/zonos-collect/zonos-collect-subtotal/zonos-collect-subtotal.d.ts +10 -0
  241. package/dist/types/components/checkout/zonos-collect/zonos-collect.d.ts +86 -0
  242. package/dist/types/components/common/zonos-h-stack/zonos-h-stack.d.ts +9 -0
  243. package/dist/types/components/common/zonos-skeleton/zonos-skeleton.d.ts +17 -0
  244. package/dist/types/components/main/zonos-controller.d.ts +5 -0
  245. package/dist/types/components/paypal/zonos-paypal-payment.d.ts +3 -0
  246. package/dist/types/components/store/checkout/cart.d.ts +23 -3
  247. package/dist/types/components/store/checkout/collect.d.ts +21 -0
  248. package/dist/types/components/store/checkout/paypal.d.ts +4 -3
  249. package/dist/types/components/store/checkout/stripe.d.ts +6 -2
  250. package/dist/types/components/store/translationStore/strings.arabic.d.ts +48 -0
  251. package/dist/types/components/store/translationStore/strings.base.d.ts +48 -0
  252. package/dist/types/components/store/translationStore/strings.chinese.d.ts +48 -0
  253. package/dist/types/components/store/translationStore/strings.danish.d.ts +48 -0
  254. package/dist/types/components/store/translationStore/strings.dutch.d.ts +48 -0
  255. package/dist/types/components/store/translationStore/strings.french.d.ts +48 -0
  256. package/dist/types/components/store/translationStore/strings.german.d.ts +48 -0
  257. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +48 -0
  258. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +48 -0
  259. package/dist/types/components/store/translationStore/strings.italian.d.ts +48 -0
  260. package/dist/types/components/store/translationStore/strings.japanese.d.ts +48 -0
  261. package/dist/types/components/store/translationStore/strings.korean.d.ts +48 -0
  262. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +48 -0
  263. package/dist/types/components/store/translationStore/strings.polish.d.ts +48 -0
  264. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +48 -0
  265. package/dist/types/components/store/translationStore/strings.russian.d.ts +48 -0
  266. package/dist/types/components/store/translationStore/strings.spanish.d.ts +48 -0
  267. package/dist/types/components/store/translationStore/strings.swedish.d.ts +48 -0
  268. package/dist/types/components/store/translationStore/strings.turkish.d.ts +48 -0
  269. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +48 -0
  270. package/dist/types/components/store/translationStore.d.ts +2 -1
  271. package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +1 -2
  272. package/dist/types/components/stripe/zonos-link-authentication/zonos-link-authentication.d.ts +2 -0
  273. package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
  274. package/dist/types/components/utils/checkout/initCollect.d.ts +1 -0
  275. package/dist/types/components/utils/checkout/isCollectMobileTablet.d.ts +4 -0
  276. package/dist/types/components/utils/getNextFallbackApi.d.ts +2 -2
  277. package/dist/types/components/utils/renderFallback.d.ts +6 -0
  278. package/dist/types/components.d.ts +401 -2
  279. package/dist/types/scripts/_zonosBase.d.ts +5 -0
  280. package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +5 -0
  281. package/dist/types/types/checkout/api/CheckoutSession.d.ts +9 -1
  282. package/dist/types/types/checkout/api/CreateParty.d.ts +24 -0
  283. package/dist/types/types/checkout/api/NormalizedTempCart.d.ts +6 -1
  284. package/dist/types/types/checkout/api/PartyInfo.d.ts +24 -0
  285. package/dist/types/types/generated/graphql.frontend.types.d.ts +1 -1
  286. package/dist/types/types/generated/graphql.frontend.types.ts +1 -1
  287. package/dist/types/types/generated/graphql.internal.types.d.ts +431 -9
  288. package/dist/types/types/generated/graphql.internal.types.ts +428 -10
  289. package/dist/types/types/index.d.ts +1 -0
  290. package/dist/zonos-elements/index.esm.js +1 -1
  291. package/dist/zonos-elements/{p-288761b1.system.entry.js → p-009c3ac5.system.entry.js} +1 -1
  292. package/dist/zonos-elements/{p-c7d5d45d.entry.js → p-03980f76.entry.js} +1 -1
  293. package/dist/zonos-elements/{p-c1d86f32.system.js → p-062430f9.system.js} +1 -1
  294. package/dist/zonos-elements/p-07bea979.system.js +1 -0
  295. package/dist/zonos-elements/p-0cec2dd2.system.entry.js +1 -0
  296. package/dist/zonos-elements/p-0d6c6a38.entry.js +1 -0
  297. package/dist/zonos-elements/p-0e28207a.js +1 -0
  298. package/dist/zonos-elements/{p-1efc348b.system.js → p-0ed63ce0.system.js} +1 -1
  299. package/dist/zonos-elements/p-0ef2a242.js +1 -0
  300. package/dist/zonos-elements/p-106ae0f1.entry.js +1 -0
  301. package/dist/zonos-elements/p-10797d2b.system.entry.js +1 -0
  302. package/dist/zonos-elements/p-195b33b6.system.entry.js +1 -0
  303. package/dist/zonos-elements/p-1fe5d4da.system.entry.js +1 -0
  304. package/dist/zonos-elements/{p-da4c01da.system.entry.js → p-2323ff0f.system.entry.js} +1 -1
  305. package/dist/zonos-elements/p-23293a0b.entry.js +1 -0
  306. package/dist/zonos-elements/{p-62813488.entry.js → p-23735db6.entry.js} +1 -1
  307. package/dist/zonos-elements/{p-ebaaaee9.entry.js → p-26573347.entry.js} +1 -1
  308. package/dist/zonos-elements/{p-e640e8b8.entry.js → p-29499a5f.entry.js} +1 -1
  309. package/dist/zonos-elements/p-29c80a34.js +1 -0
  310. package/dist/zonos-elements/{p-edc77ea1.entry.js → p-2a9681b4.entry.js} +1 -1
  311. package/dist/zonos-elements/{p-3f31901f.entry.js → p-2c9381be.entry.js} +1 -1
  312. package/dist/zonos-elements/p-2cc031b3.js +17 -0
  313. package/dist/zonos-elements/{p-7ab62a26.system.entry.js → p-34a37ce7.system.entry.js} +1 -1
  314. package/dist/zonos-elements/p-3c9714a8.system.entry.js +1 -0
  315. package/dist/zonos-elements/p-485416ec.js +1 -0
  316. package/dist/zonos-elements/p-56ee6d4b.system.entry.js +1 -0
  317. package/dist/zonos-elements/p-58afbe2b.entry.js +1 -0
  318. package/dist/zonos-elements/p-5e372fb9.entry.js +1 -0
  319. package/dist/zonos-elements/p-5ff4f9df.system.js +1 -0
  320. package/dist/zonos-elements/{p-92cc26b7.system.entry.js → p-60c61982.system.entry.js} +1 -1
  321. package/dist/zonos-elements/p-61c2c336.entry.js +1 -0
  322. package/dist/zonos-elements/p-6696617a.system.entry.js +1 -0
  323. package/dist/zonos-elements/p-6761091e.entry.js +1 -0
  324. package/dist/zonos-elements/p-6761286d.js +1 -0
  325. package/dist/zonos-elements/p-69451a50.system.js +1 -0
  326. package/dist/zonos-elements/p-69fd1b88.js +1 -0
  327. package/dist/zonos-elements/p-6dd63754.system.js +1 -0
  328. package/dist/zonos-elements/p-6e8aae27.system.entry.js +1 -0
  329. package/dist/zonos-elements/{p-1c45cd15.entry.js → p-70b81bbc.entry.js} +1 -1
  330. package/dist/zonos-elements/{p-eeb01de6.system.entry.js → p-750b7f32.system.entry.js} +1 -1
  331. package/dist/zonos-elements/p-772ac0b7.js +1 -0
  332. package/dist/zonos-elements/p-81b357f7.system.js +1 -1
  333. package/dist/zonos-elements/p-81e23f30.system.js +1 -0
  334. package/dist/zonos-elements/p-873b698a.entry.js +1 -0
  335. package/dist/zonos-elements/p-87e2a777.entry.js +1 -0
  336. package/dist/zonos-elements/p-8ca25e6c.entry.js +1 -0
  337. package/dist/zonos-elements/p-909d36bf.entry.js +1 -0
  338. package/dist/zonos-elements/p-95461a1b.system.entry.js +1 -0
  339. package/dist/zonos-elements/p-986ebccc.js +1 -0
  340. package/dist/zonos-elements/p-9c0b78bf.system.entry.js +1 -0
  341. package/dist/zonos-elements/p-a61a9b65.system.entry.js +1 -0
  342. package/dist/zonos-elements/p-a7204d41.entry.js +1 -0
  343. package/dist/zonos-elements/{p-d93ecc57.js → p-a8a312b2.js} +1 -1
  344. package/dist/zonos-elements/p-aca272ea.entry.js +1 -0
  345. package/dist/zonos-elements/p-b12ec9f2.system.entry.js +1 -0
  346. package/dist/zonos-elements/p-b1bd9fe7.system.entry.js +1 -0
  347. package/dist/zonos-elements/p-b2ae8eb7.system.js +1 -0
  348. package/dist/zonos-elements/{p-77666360.entry.js → p-b5406d26.entry.js} +1 -1
  349. package/dist/zonos-elements/p-bfbc081f.entry.js +1 -0
  350. package/dist/zonos-elements/p-c0a54cf6.system.js +1 -0
  351. package/dist/zonos-elements/p-c3c9b089.entry.js +1 -0
  352. package/dist/zonos-elements/p-c8784a01.system.entry.js +1 -0
  353. package/dist/zonos-elements/{p-7b5de646.entry.js → p-d045e2e5.entry.js} +1 -1
  354. package/dist/zonos-elements/p-d26cffba.entry.js +1 -0
  355. package/dist/zonos-elements/{p-544c173a.system.entry.js → p-d351ece6.system.entry.js} +1 -1
  356. package/dist/zonos-elements/p-d63696ac.system.js +17 -0
  357. package/dist/zonos-elements/p-ddb29c2a.system.entry.js +1 -0
  358. package/dist/zonos-elements/{p-d6fa2dc2.entry.js → p-dfb92907.entry.js} +1 -1
  359. package/dist/zonos-elements/{p-714c28b1.system.entry.js → p-e2a45188.system.entry.js} +1 -1
  360. package/dist/zonos-elements/{p-1ac8bfbb.system.entry.js → p-e455f060.system.entry.js} +1 -1
  361. package/dist/zonos-elements/p-eb54ece4.system.entry.js +1 -0
  362. package/dist/zonos-elements/{p-a98b1e8d.entry.js → p-efa6203f.entry.js} +1 -1
  363. package/dist/zonos-elements/{p-59eaebe3.system.entry.js → p-f0be0ca9.system.entry.js} +1 -1
  364. package/dist/zonos-elements/p-f129a83b.system.entry.js +1 -0
  365. package/dist/zonos-elements/p-f17fde5f.system.js +1 -0
  366. package/dist/zonos-elements/{p-47ffacd8.system.entry.js → p-f74a6b78.system.entry.js} +1 -1
  367. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  368. package/package.json +1 -1
  369. package/dist/cjs/zonos-card.cjs.entry.js +0 -49
  370. package/dist/esm/zonos-card.entry.js +0 -45
  371. package/dist/esm-es5/cart-010402f9.js +0 -1
  372. package/dist/esm-es5/localization-9db8b6e9.js +0 -1
  373. package/dist/esm-es5/paypal-70b140d9.js +0 -17
  374. package/dist/esm-es5/zonos-banner.entry.js +0 -1
  375. package/dist/esm-es5/zonos-card.entry.js +0 -1
  376. package/dist/esm-es5/zonos-cart-items_14.entry.js +0 -1
  377. package/dist/zonos-elements/p-043f57e8.system.entry.js +0 -1
  378. package/dist/zonos-elements/p-0a7ef032.entry.js +0 -1
  379. package/dist/zonos-elements/p-0e8bdf5c.js +0 -1
  380. package/dist/zonos-elements/p-164ba7ae.system.entry.js +0 -1
  381. package/dist/zonos-elements/p-242dd7ca.system.entry.js +0 -1
  382. package/dist/zonos-elements/p-300e0d47.system.entry.js +0 -1
  383. package/dist/zonos-elements/p-37aa481c.system.entry.js +0 -1
  384. package/dist/zonos-elements/p-3a1513ae.system.entry.js +0 -1
  385. package/dist/zonos-elements/p-425096c9.js +0 -1
  386. package/dist/zonos-elements/p-4cd33d08.entry.js +0 -1
  387. package/dist/zonos-elements/p-57f391e6.system.entry.js +0 -1
  388. package/dist/zonos-elements/p-58b3a0fc.entry.js +0 -1
  389. package/dist/zonos-elements/p-605a21ac.entry.js +0 -1
  390. package/dist/zonos-elements/p-608f965f.system.js +0 -1
  391. package/dist/zonos-elements/p-65c68531.js +0 -1
  392. package/dist/zonos-elements/p-680149ed.entry.js +0 -1
  393. package/dist/zonos-elements/p-6d44f441.system.js +0 -1
  394. package/dist/zonos-elements/p-7c88d2ac.entry.js +0 -1
  395. package/dist/zonos-elements/p-9ddb4533.system.entry.js +0 -1
  396. package/dist/zonos-elements/p-a91024b6.system.entry.js +0 -1
  397. package/dist/zonos-elements/p-a9d41e7c.system.entry.js +0 -1
  398. package/dist/zonos-elements/p-ad556be6.entry.js +0 -1
  399. package/dist/zonos-elements/p-ad8b1fe8.entry.js +0 -1
  400. package/dist/zonos-elements/p-afa4b4f0.js +0 -17
  401. package/dist/zonos-elements/p-b83b382e.system.js +0 -1
  402. package/dist/zonos-elements/p-b9ff6458.entry.js +0 -1
  403. package/dist/zonos-elements/p-d55aec11.system.entry.js +0 -1
  404. package/dist/zonos-elements/p-dcedcdda.entry.js +0 -1
  405. package/dist/zonos-elements/p-e11c61a5.entry.js +0 -1
  406. package/dist/zonos-elements/p-e17ac0d1.system.js +0 -17
  407. package/dist/zonos-elements/p-e1a7a85f.system.entry.js +0 -1
  408. package/dist/zonos-elements/p-ef1ce617.system.entry.js +0 -1
  409. package/dist/zonos-elements/p-ef34e1ce.entry.js +0 -1
  410. package/dist/zonos-elements/p-f54123b5.entry.js +0 -1
  411. package/dist/zonos-elements/p-f7300f5b.system.entry.js +0 -1
@@ -0,0 +1,28 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Map the items from tempCart like how we do it in dgs
5
+ * @ref https://github.com/Zonos/ShippingQuoteService/blob/f8bd4f1ff41cb34b49b9f3f435576ec28dedf906/src/main/java/com/iglobal/services/shippingquote/dto/ShippingQuoteRequestDto.java#L393
6
+ */
7
+ const buildCartItemsByTempCart = (tempCartData) => {
8
+ const tempCartItems = tempCartData.items.map(item => ({
9
+ amount: item.amount,
10
+ attributes: item.attributes || [],
11
+ countryOfOrigin: item.countryOfOrigin || undefined,
12
+ currencyCode: item.currencyCode,
13
+ description: item.description || '',
14
+ imageUrl: item.imageUrl || '',
15
+ itemType: item.itemType || 'PHYSICAL_GOOD',
16
+ measurements: item.measurements || [],
17
+ name: item.name || item.description || '',
18
+ productId: item.productId || '',
19
+ quantity: item.quantity || 0,
20
+ sku: item.sku || '',
21
+ })) || [];
22
+ return {
23
+ adjustments: tempCartData.adjustments,
24
+ cartItems: tempCartItems,
25
+ };
26
+ };
27
+
28
+ exports.buildCartItemsByTempCart = buildCartItemsByTempCart;
@@ -1,8 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  const zonosStore = require('./zonosStore-f8ee56aa.js');
4
- const localization = require('./localization-721a5ec3.js');
5
- const handleFetch = require('./handleFetch-0313ebba.js');
4
+ const localization = require('./localization-b12edb2a.js');
5
+ const translationStore = require('./translationStore-20a6d8bf.js');
6
+ const handleFetch = require('./handleFetch-45f35cac.js');
6
7
  const isDarkColor = require('./isDarkColor-428965f4.js');
7
8
  const getBorderRadius = require('./getBorderRadius-1b5e33cf.js');
8
9
 
@@ -532,7 +533,7 @@ const validateCheckoutSession = async () => {
532
533
  metadata: { allLogs: handleFetch.allLogs },
533
534
  });
534
535
  return {
535
- errorMessage: localization.translate('Unable to retrieve the checkout session at the moment. Please try again or contact our support team.'),
536
+ errorMessage: translationStore.translate('Unable to retrieve the checkout session at the moment. Please try again or contact our support team.'),
536
537
  valid: false,
537
538
  };
538
539
  }
@@ -545,7 +546,7 @@ const validateCheckoutSession = async () => {
545
546
  metadata: { allLogs: handleFetch.allLogs },
546
547
  });
547
548
  return {
548
- errorMessage: localization.translate('No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.'),
549
+ errorMessage: translationStore.translate('No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.'),
549
550
  valid: false,
550
551
  };
551
552
  }
@@ -755,15 +756,15 @@ const initStripeElements = async (props) => {
755
756
  JSON.stringify(stripeStore.stripeElementsOptions);
756
757
  if (!stripeStore.stripeElements ||
757
758
  !stripeStore.stripeElementsForBillingAddress) {
759
+ // init stripe elements for billing address
760
+ stripeStore.stripeElementsForBillingAddress =
761
+ (_a = stripeStore.stripe) === null || _a === void 0 ? void 0 : _a.elements(stripeOptions);
762
+ handleFetch.log('Stripe elements for billing address initialized');
758
763
  // init stripe elements if it doesn't exist
759
- stripeStore.stripeElements = (_a = stripeStore.stripe) === null || _a === void 0 ? void 0 : _a.elements(stripeOptions);
764
+ stripeStore.stripeElements = (_b = stripeStore.stripe) === null || _b === void 0 ? void 0 : _b.elements(stripeOptions);
760
765
  // save stripe elements options for later comparison
761
766
  stripeStore.stripeElementsOptions = stripeOptions;
762
767
  handleFetch.log('Stripe elements initialized');
763
- // init stripe elements for billing address
764
- stripeStore.stripeElementsForBillingAddress =
765
- (_b = stripeStore.stripe) === null || _b === void 0 ? void 0 : _b.elements(stripeOptions);
766
- handleFetch.log('Stripe elements for billing address initialized');
767
768
  return;
768
769
  }
769
770
  if (!isSameOptions) {
@@ -809,7 +810,7 @@ const checkIsAddressOutdatedForAsyncAddressUpdate = () => {
809
810
  isTaxIdDirty ||
810
811
  isCompanyNameDirty);
811
812
  };
812
- const buildAddressForPartyCreate = ({ address, firstName, lastName, name, phone, }) => {
813
+ const stripeStoreBuildAddressForPartyCreate = ({ address, firstName, lastName, name, phone, }) => {
813
814
  const { firstName: _firstName, lastName: _lastName } = extractName({
814
815
  firstName,
815
816
  lastName,
@@ -891,7 +892,7 @@ const stripeStoreAsyncAddressUpdate = async () => {
891
892
  partiesCreated: false,
892
893
  };
893
894
  }
894
- const address = buildAddressForPartyCreate({
895
+ const address = stripeStoreBuildAddressForPartyCreate({
895
896
  address: stripeStore.stripeAddressEventData.value.address,
896
897
  firstName: stripeStore.stripeAddressEventData.value.firstName,
897
898
  lastName: stripeStore.stripeAddressEventData.value.lastName,
@@ -900,7 +901,7 @@ const stripeStoreAsyncAddressUpdate = async () => {
900
901
  });
901
902
  const billingAddress = stripeStore.stripeShippingSameAsBilling
902
903
  ? address
903
- : buildAddressForPartyCreate({
904
+ : stripeStoreBuildAddressForPartyCreate({
904
905
  address: stripeStore.stripeBillingAddressEventData.value.address,
905
906
  firstName: stripeStore.stripeBillingAddressEventData.value.firstName,
906
907
  lastName: stripeStore.stripeBillingAddressEventData.value.lastName,
@@ -1210,7 +1211,11 @@ const stripeStoreApplyPromoCode = async () => {
1210
1211
  if (!cheapestServiceLevel || !matchLandedCost) {
1211
1212
  return;
1212
1213
  }
1213
- await cartStoreUpdateSelectedShippingOption(cheapestServiceLevel, matchLandedCost.landedCostId);
1214
+ await cartStoreUpdateSelectedShippingOption({
1215
+ applySubtotalsOnly: false,
1216
+ landedCostId: matchLandedCost.landedCostId,
1217
+ selectedShippingOption: cheapestServiceLevel,
1218
+ });
1214
1219
  };
1215
1220
  const stripeStoreResetPromoCode = () => {
1216
1221
  cartStore.promoCode = '';
@@ -1230,6 +1235,7 @@ const stripeStoreRemovePromoCode = async () => {
1230
1235
  const stripeStoreMessageBasedOnStatus = (status) => {
1231
1236
  let messages = [];
1232
1237
  let isError = true;
1238
+ const isCollect = window.Zonos.isCollect;
1233
1239
  // Inspect the PaymentIntent `status` to indicate the status of the payment
1234
1240
  // to your customer.
1235
1241
  //
@@ -1240,35 +1246,47 @@ const stripeStoreMessageBasedOnStatus = (status) => {
1240
1246
  switch (status) {
1241
1247
  case 'succeeded': {
1242
1248
  messages = [
1243
- localization.translate('Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.'),
1249
+ translationStore.translate('Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.'),
1244
1250
  '',
1245
- localization.translate("We've sent an email confirmation of the order details for your review. And our team is carefully preparing your order so it arrives on time."),
1251
+ translationStore.translate("We've sent an email confirmation of the order details for your review. And our team is carefully preparing your order so it arrives on time."),
1246
1252
  ];
1253
+ if (isCollect) {
1254
+ messages = [
1255
+ translationStore.translate('Thank you for submitting your payment. We appreciate your prompt attention.'),
1256
+ '',
1257
+ translationStore.translate('A confirmation email with your payment details has been sent for your records. If you have any questions or need support, our team is here to help.'),
1258
+ ];
1259
+ }
1247
1260
  isError = false;
1248
1261
  break;
1249
1262
  }
1250
1263
  case 'requires_capture':
1251
1264
  case 'processing': {
1252
1265
  messages = [
1253
- localization.translate("Payment processing. We'll update you when payment is received."),
1266
+ translationStore.translate("Payment processing. We'll update you when payment is received."),
1254
1267
  ];
1255
1268
  isError = false;
1256
1269
  break;
1257
1270
  }
1258
1271
  case 'requires_payment_method': {
1259
1272
  messages = [
1260
- localization.translate('Payment failed. Please try another payment method.'),
1273
+ translationStore.translate('Payment failed. Please try another payment method.'),
1261
1274
  ];
1275
+ if (isCollect) {
1276
+ messages = [
1277
+ translationStore.translate('Payment failed. Please reload the page and try another payment method.'),
1278
+ ];
1279
+ }
1262
1280
  break;
1263
1281
  }
1264
1282
  case 'requires_action': {
1265
1283
  isError = false;
1266
1284
  messages = [
1267
- localization.translate('Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.'),
1285
+ translationStore.translate('Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.'),
1268
1286
  ];
1269
1287
  }
1270
1288
  default: {
1271
- messages = [localization.translate('Something went wrong.')];
1289
+ messages = [translationStore.translate('Something went wrong.')];
1272
1290
  break;
1273
1291
  }
1274
1292
  }
@@ -1300,7 +1318,7 @@ const stripeStoreHandleInventoryCheck = async () => {
1300
1318
  }
1301
1319
  // Proceed if the item is available
1302
1320
  if (!json.available || json.status === 204) {
1303
- return localization.translate("The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.");
1321
+ return translationStore.translate("The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.");
1304
1322
  }
1305
1323
  if (json.available || json.status === 200) {
1306
1324
  stripeStore.shouldInventoryRefund = true;
@@ -1358,7 +1376,7 @@ const stripeStoreRetrievePayment = async ({ clientSecret: _clientSecret, storybo
1358
1376
  const clientSecret = _clientSecret || stripeStore.clientSecret;
1359
1377
  if (!stripeStore.stripe || !clientSecret) {
1360
1378
  handleFetch.logError('Failed to retrieve payment intent. Stripe is not initialized');
1361
- return { error: true, message: [localization.translate('Something went wrong.')] };
1379
+ return { error: true, message: [translationStore.translate('Something went wrong.')] };
1362
1380
  }
1363
1381
  const { paymentIntent } = await stripeStore.stripe.retrievePaymentIntent(clientSecret);
1364
1382
  const status = paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.status;
@@ -1371,14 +1389,15 @@ const stripeStoreRetrievePayment = async ({ clientSecret: _clientSecret, storybo
1371
1389
  status,
1372
1390
  };
1373
1391
  };
1374
- const stripeStoreConfirmPayment = async () => {
1392
+ const stripeStoreConfirmPayment = async (props) => {
1375
1393
  var _a, _b;
1376
1394
  const stripePaymentReady = !!((_a = stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.complete);
1377
1395
  const stripeElements = stripeStore.stripeElements;
1378
1396
  const stripe = stripeStore.stripe;
1379
1397
  const stripeClientSecret = stripeStore.clientSecret;
1380
1398
  stripeStore.customErrorMessage = null;
1381
- if (!((_b = cartStore.selectedLandedCost) === null || _b === void 0 ? void 0 : _b.landedCost.id)) {
1399
+ if (!((_b = cartStore.selectedLandedCost) === null || _b === void 0 ? void 0 : _b.landedCost.id) &&
1400
+ !(props === null || props === void 0 ? void 0 : props.noLandedCostCheck)) {
1382
1401
  throw new Error('Attempted to confirm the payment when no landed cost is found in store');
1383
1402
  }
1384
1403
  // Check if the checkout session is valid before proceeding
@@ -1409,7 +1428,7 @@ const stripeStoreConfirmPayment = async () => {
1409
1428
  });
1410
1429
  handleFetch.log('Payment intent confirmed', 'info', { error, paymentIntent });
1411
1430
  if ((paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.status) === 'requires_action') {
1412
- throw new Error(localization.translate('Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.'));
1431
+ throw new Error(translationStore.translate('Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.'));
1413
1432
  }
1414
1433
  if (error) {
1415
1434
  if (error.type === 'card_error' || error.type === 'validation_error') {
@@ -1426,7 +1445,7 @@ const stripeStoreConfirmPayment = async () => {
1426
1445
  }
1427
1446
  if (paymentIntent.status === 'requires_payment_method') {
1428
1447
  // Failed to confirm payment, allows user to try another payment method
1429
- throw new Error(localization.translate('Payment failed. Please try another payment method.'));
1448
+ throw new Error(translationStore.translate('Payment failed. Please try another payment method.'));
1430
1449
  }
1431
1450
  }
1432
1451
  };
@@ -1439,6 +1458,7 @@ const getCheckoutSessionBody = () => {
1439
1458
  cartId: window.Zonos.cartId,
1440
1459
  currency: ((_a = cartStore.items.find(Boolean)) === null || _a === void 0 ? void 0 : _a.currencyCode) || '',
1441
1460
  customerAuthenticationToken: cartStore.customerAuthenticationToken || undefined,
1461
+ isCollect: window.Zonos.isCollect,
1442
1462
  itemsAmount: total,
1443
1463
  metadata: [
1444
1464
  {
@@ -1466,9 +1486,9 @@ const stripeStoreGetPaymentIntent = async () => {
1466
1486
  });
1467
1487
  cartStoreUpdateToErrorState({
1468
1488
  messages: [
1469
- localization.translate("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists"),
1489
+ translationStore.translate("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists"),
1470
1490
  ],
1471
- title: localization.translate('Error creating Checkout'),
1491
+ title: translationStore.translate('Error creating Checkout'),
1472
1492
  });
1473
1493
  return;
1474
1494
  }
@@ -1494,9 +1514,9 @@ const stripeStoreGetPaymentIntent = async () => {
1494
1514
  });
1495
1515
  cartStoreUpdateToErrorState({
1496
1516
  messages: [
1497
- localization.translate("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists"),
1517
+ translationStore.translate("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists"),
1498
1518
  ],
1499
- title: localization.translate('Error creating Checkout'),
1519
+ title: translationStore.translate('Error creating Checkout'),
1500
1520
  });
1501
1521
  return;
1502
1522
  }
@@ -1800,12 +1820,12 @@ const { onChange: cartStoreOnChange, reset, state: cartStore, } = zonosStore.cre
1800
1820
  const getTransitUnit = (type) => {
1801
1821
  switch (type) {
1802
1822
  case 'DAYS':
1803
- return localization.translate('days');
1823
+ return translationStore.translate('days');
1804
1824
  case 'WEEKS':
1805
- return localization.translate('weeks');
1825
+ return translationStore.translate('weeks');
1806
1826
  case 'BUSINESS_DAYS':
1807
1827
  default:
1808
- return localization.translate('business days');
1828
+ return translationStore.translate('business days');
1809
1829
  }
1810
1830
  };
1811
1831
  /**
@@ -1971,9 +1991,9 @@ const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency,
1971
1991
  if (!success) {
1972
1992
  cartStoreUpdateToErrorState({
1973
1993
  messages: [
1974
- localization.translate("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists"),
1994
+ translationStore.translate("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists"),
1975
1995
  ],
1976
- title: localization.translate('Error creating Checkout'),
1996
+ title: translationStore.translate('Error creating Checkout'),
1977
1997
  });
1978
1998
  return false;
1979
1999
  }
@@ -2010,8 +2030,12 @@ const cartStoreGetMethod = (landedCost) => {
2010
2030
  }
2011
2031
  return landedCost.method;
2012
2032
  };
2013
- const cartStoreUpdateSelectedShippingOption = async (selectedShippingOption, landedCostId) => {
2033
+ const cartStoreUpdateSelectedShippingOption = async ({ applySubtotalsOnly, landedCostId, selectedShippingOption, }) => {
2014
2034
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
2035
+ handleFetch.log('Updating selected shipping option', 'info', {
2036
+ landedCostId,
2037
+ selectedShippingOption,
2038
+ });
2015
2039
  cartStore.selectedShippingOption = selectedShippingOption;
2016
2040
  // update shipping transit info
2017
2041
  const transitData = cartStoreGetShippingTransitInfo(cartStore.selectedShippingOption);
@@ -2046,16 +2070,33 @@ const cartStoreUpdateSelectedShippingOption = async (selectedShippingOption, lan
2046
2070
  const isAboveDeminimis = !!((_e = (_d = selectedLandedCost === null || selectedLandedCost === void 0 ? void 0 : selectedLandedCost.landedCost) === null || _d === void 0 ? void 0 : _d.deMinimis) === null || _e === void 0 ? void 0 : _e.find(item => ['DUTY', 'TAX'].includes(item.type) && item.threshold === 'ABOVE'));
2047
2071
  cartStore.isSelectedShippingAboveDeminimis = isAboveDeminimis;
2048
2072
  cartStore.isSelectedShippingGuarantee = isGuarantee;
2049
- // update session with selected landed cost
2050
- const updateCalculateStatus = await cartStoreReCalculateTotal({
2051
- adjustmentsAmount: cartStore.adjustmentTotal,
2052
- billToPartyId: stripeStore.partyBillingId,
2053
- cartId: window.Zonos.cartId,
2054
- dutiesTaxesFeesEstimate: dutiesTaxesFeesEstimate,
2055
- landedCostId: (_f = selectedLandedCost.landedCost) === null || _f === void 0 ? void 0 : _f.id,
2056
- shipToPartyId: stripeStore.partyShippingId,
2057
- varianceTestInput: localization.storageStore.enabledVariantTestKeys || [],
2058
- });
2073
+ let updateCalculateStatus = false;
2074
+ /**
2075
+ * For collect, we are trying to mimic the behavior that checkout is currently doing, where there is already a checkout session, we already updated with the landed cost.
2076
+ * But we need to call this function so that we can use all of the information that already in place in cartStore, so to avoid latency issue, we only apply subtotals here.
2077
+ */
2078
+ if (applySubtotalsOnly) {
2079
+ const subtotals = selectedLandedCost.subtotals;
2080
+ cartStoreApplySubtotals({
2081
+ dutiesTaxesFeesEstimate,
2082
+ method: cartStore.landedCostMethod,
2083
+ subtotals,
2084
+ });
2085
+ handleFetch.log('Exchange rate updated for cart items (landed cost subtotal)', 'info', cartStore.exchangeRate);
2086
+ updateCalculateStatus = true;
2087
+ }
2088
+ else {
2089
+ // update session with selected landed cost
2090
+ updateCalculateStatus = await cartStoreReCalculateTotal({
2091
+ adjustmentsAmount: cartStore.adjustmentTotal,
2092
+ billToPartyId: stripeStore.partyBillingId,
2093
+ cartId: window.Zonos.cartId,
2094
+ dutiesTaxesFeesEstimate: dutiesTaxesFeesEstimate,
2095
+ landedCostId: (_f = selectedLandedCost.landedCost) === null || _f === void 0 ? void 0 : _f.id,
2096
+ shipToPartyId: stripeStore.partyShippingId,
2097
+ varianceTestInput: localization.storageStore.enabledVariantTestKeys || [],
2098
+ });
2099
+ }
2059
2100
  // update conditionally render pay in USD button
2060
2101
  const firstItem = (_g = cartStore.items.find(Boolean)) === null || _g === void 0 ? void 0 : _g.currencyCode;
2061
2102
  // Stripe address event data should be available at this point
@@ -2097,7 +2138,7 @@ const cartStoreResetCartItems = () => {
2097
2138
  cartStore.items = cartStore.items.map(item => (Object.assign(Object.assign({}, item), { isRestricted: false })));
2098
2139
  cartStore.restrictedItems = [];
2099
2140
  };
2100
- const cartStoreUpdateItems = async ({ adjustments, cartItems, }) => {
2141
+ const cartStoreUpdateItems = async ({ adjustments, cartItems, landedCostId, shouldInitSessionOnFailure = true, }) => {
2101
2142
  var _a;
2102
2143
  // Update adjustments and items
2103
2144
  cartStore.adjustments = adjustments;
@@ -2121,9 +2162,9 @@ const cartStoreUpdateItems = async ({ adjustments, cartItems, }) => {
2121
2162
  currency: currency,
2122
2163
  dutiesTaxesFeesEstimate: 0,
2123
2164
  itemsAmount: total,
2165
+ landedCostId,
2124
2166
  shipToPartyId: stripeStore.partyShippingId,
2125
- // attempt to init session on failure to update checkout session
2126
- shouldInitSessionOnFailure: true,
2167
+ shouldInitSessionOnFailure,
2127
2168
  varianceTestInput: localization.storageStore.enabledVariantTestKeys || [],
2128
2169
  });
2129
2170
  stripeStore.isFetchingSession = false;
@@ -2198,6 +2239,7 @@ exports.sortServiceLevelOptionsByAmount = sortServiceLevelOptionsByAmount;
2198
2239
  exports.stripeStore = stripeStore;
2199
2240
  exports.stripeStoreApplyPromoCode = stripeStoreApplyPromoCode;
2200
2241
  exports.stripeStoreAsyncAddressUpdate = stripeStoreAsyncAddressUpdate;
2242
+ exports.stripeStoreBuildAddressForPartyCreate = stripeStoreBuildAddressForPartyCreate;
2201
2243
  exports.stripeStoreCleanupDomesticShippingSession = stripeStoreCleanupDomesticShippingSession;
2202
2244
  exports.stripeStoreConfirmPayment = stripeStoreConfirmPayment;
2203
2245
  exports.stripeStoreGetDomesticShippingSession = stripeStoreGetDomesticShippingSession;
@@ -2206,6 +2248,7 @@ exports.stripeStoreHandleInventoryCheck = stripeStoreHandleInventoryCheck;
2206
2248
  exports.stripeStoreHandleInventoryRefund = stripeStoreHandleInventoryRefund;
2207
2249
  exports.stripeStoreInitCheckoutSession = stripeStoreInitCheckoutSession;
2208
2250
  exports.stripeStoreMessageBasedOnStatus = stripeStoreMessageBasedOnStatus;
2251
+ exports.stripeStoreOnChange = stripeStoreOnChange;
2209
2252
  exports.stripeStorePrefetchLandedCost = stripeStorePrefetchLandedCost;
2210
2253
  exports.stripeStoreRemovePromoCode = stripeStoreRemovePromoCode;
2211
2254
  exports.stripeStoreReset = stripeStoreReset;